package com.xiaotian.manage.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.xiaotian.common.code.CommonCode;
import com.xiaotian.common.response.QueryBeanResult;
import com.xiaotian.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/users")
public class UserController {

    @Reference(loadbalance = "random")
    private UserService userService;

    @GetMapping
    public QueryBeanResult<Map<String, Object>> test() {

        Map<String, Object> map = userService.test();
        return new QueryBeanResult<>(CommonCode.SUCCESS, map);
    }
}
